[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 chdir()                 Change Current Working Directory

 #include   <dir.h>                      Required for declarations only

 int        chdir(pathname);
 const char *pathname;                   Path Name of new working directory

    chdir() changes the current working directory to the one specified by
    'pathname'.

       Returns:     0, if successful. If the specified path could not be
                    found, -1 is returned and 'errno' is set to ENOENT.

         Notes:     'pathname' must refer to an existing directory. When
                    referring to the root directory, use either the
                    forward slash ("/") or two backslashes ("\\").

                    'Pathname' can specify the current working directory.

                    'Pathname' can include a drive letter.

   -------------------------------- Example ---------------------------------

    Assuming the subdirectory "TEST" is defined in the root directory,
    the following statement changes the current working directory to
    '/TEST':

           #include <dir.h>

           main()
           {
               chdir("/TEST");
           }



See Also: mkdir() rmdir() system()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson